package com.yt.website.action;

import com.yt.website.action.base.BaseAction;
import org.codehaus.jackson.map.deser.ValueInstantiators;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Controller
@RequestMapping("/my")
public class MyAction extends BaseAction{

    @RequestMapping("/home")
    public ModelAndView index() {
        ModelAndView mav = new ModelAndView("my/home");
        return mav;
    }

    @RequestMapping("/logout")
    public void logout(HttpServletRequest request, HttpServletResponse response) throws Exception {
        setLoginUser(request, null);
        response.sendRedirect(getContextPath(request) + "/toLogin");
    }
}
